"""
生成测试报告的步骤：
1.创建测试套件实例
2.添加测试类
3.创建HTMLTestReport 类实例
4.runner 调用run(),传入suite
"""
import unittest

from config import BASE_DIR
from scripts.test_sca_login import TestScaLogin
# from apiAutoTestFrameWorkSCA0417.scripts.test_sca_login_params import TestScaLoginParams

from htmltestreport import HTMLTestReport
# 创建测试套件
suite = unittest.TestSuite()
# 创建用例装载器对象
loader = unittest.TestLoader()
# 将测试用例装在到测试套件中
suite.addTest(loader.loadTestsFromTestCase(TestScaLogin))
# suite.addTest(loader.loadTestsFromTestCase(TestScaLoginParams))
# 创建HTMLTestReport 类实例
# runner = HTMLTestReport(BASE_DIR + "/report/sca_0417_demo.html",description="登录演示",title="演示")  # 绝对路径
runner = HTMLTestReport("./report/sca_0417_demo.html",description="登录演示",title="演示")  # 相对路径

runner.run(suite)